<template>
  <div class="app-container">
    <el-container>
       <el-header  style="position:relative;">
        <h2 style="display: inline-block;">重点地区引流</h2>
      </el-header>
      <el-main>
        <div class="condition">
          <p>引流条件</p>
          <div class="check">
            <el-checkbox-group v-model="checkList">
              <el-checkbox label="来话"></el-checkbox>
              <el-checkbox label="去话"></el-checkbox>
            </el-checkbox-group>
          </div>
        </div>
        <div class="region">
          <p>引流地区</p>
          <div class="check">
            <el-checkbox
              :indeterminate="isIndeterminate"
              v-model="checkAll"
              @change="handleCheckAllChange"
            >全选</el-checkbox>
            <div style="margin: 15px 0;"></div>
            <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
              <el-checkbox v-for="item in city" :label="item" :key="item">
                {{item}}
                <span>策略标识: 235</span>
                <span>规则号: 2040</span>
              </el-checkbox>
            </el-checkbox-group>
          </div>
        </div>
 </el-main>
    </el-container>
  </div>
</template>

<script>
import city from "../../enum/city";

export default {
  data() {
    return {
      components: {

      },
      isIndeterminate: false,
      checkAll: false,
      checkedCities: [],
      checkList: [],
      city,
    };
  },
  crerted() {
    console.log(this.city, "222");
  },
  methods: {
    handleCheckAllChange(val) {
      this.checkedCities = val ? city : [];
      this.isIndeterminate = false;
    },
    handleCheckedCitiesChange(value) {
      let checkedCount = value.length;
      this.checkAll = checkedCount === this.cities.length;
      this.isIndeterminate =
        checkedCount > 0 && checkedCount < this.cities.length;
    },
  },
};
</script>

<style lang="less" scoped>
.condition {
  width: 100%;
  height: 150px;
  border: 2px solid #409eff;
  p {
    font-size: 18px;
    font-weight: 500;
    margin-left: 20px;
    color: #1736a2;
  }
  .check {
    margin: 40px 40px;
  }
}
.region {
  width: 100%;
  height: 100%;
  border: 2px solid #409eff;
  margin-top: 50px;
  p {
    font-size: 18px;
    font-weight: 500;
    margin-left: 20px;
    color: #1736a2;
  }
}
.el-checkbox {
  margin: 10px 20px;
}
.el-checkbox-group{
  margin-top: -16px;
}
</style>
